Repository navigation
docs: Add AI Button - #11068
Merged
Merged
docs: Add AI Button#11068
Conversation
|
Build successful! 🎉 |
reidbarber
previously approved these changes
Dec 1, 2026
yihuiliao
reviewed
Dec 1, 2026
| importSource="@react-spectrum/ai" | ||
| type="s2" /> | ||
|
|
||
| ### Icon only |
Member
There was a problem hiding this comment.
can we handle the icon only example like we do in the S2 button docs using the controls?
Member
Author
There was a problem hiding this comment.
Yeah, so the reason I did it this way was because the label has to disappear entirely, undefined, but technically we should still have an aria-label, which I didn't want to put in the jsx of the rendered code with some random string we chose.
Member
Author
There was a problem hiding this comment.
our example in S2 Button also ends up with an unlabeled example if you make it icon only :-/
yihuiliao
approved these changes
Dec 2, 2026
|
Build successful! 🎉 |
## API Changes
@react-spectrum/ai/@react-spectrum/ai:AIButton AIButton {
aria-controls?: string
aria-current?: boolean | 'true' | 'false' | 'page' | 'step' | 'location' | 'date' | 'time'
aria-describedby?: string
aria-details?: string
aria-disabled?: boolean | 'true' | 'false'
aria-expanded?: boolean | 'true' | 'false'
aria-haspopup?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | 'true' | 'false'
aria-label?: string
aria-labelledby?: string
aria-pressed?: boolean | 'true' | 'false' | 'mixed'
autoFocus?: boolean
- brandColor?: string
children?: string
excludeFromTabOrder?: boolean
form?: string
formAction?: ButtonHTMLAttributes<HTMLButtonElement>['formAction']
formEncType?: string
formMethod?: string
formNoValidate?: boolean
formTarget?: string
id?: string
isDisabled?: boolean
name?: string
onBlur?: (FocusEvent<Target>) => void
onFocus?: (FocusEvent<Target>) => void
onFocusChange?: (boolean) => void
onKeyDown?: (KeyboardEvent) => void
onKeyUp?: (KeyboardEvent) => void
onPress?: (PressEvent) => void
onPressChange?: (boolean) => void
onPressEnd?: (PressEvent) => void
onPressStart?: (PressEvent) => void
onPressUp?: (PressEvent) => void
preventFocusOnPress?: boolean
- size?: 'S' | 'M' | 'L' | 'XL'
+ size?: 'S' | 'M' | 'L' | 'XL' = 'M'
slot?: string | null
type?: 'button' | 'submit' | 'reset' = 'button'
value?: string
}/@react-spectrum/ai:AIButtonProps AIButtonProps {
aria-controls?: string
aria-current?: boolean | 'true' | 'false' | 'page' | 'step' | 'location' | 'date' | 'time'
aria-describedby?: string
aria-details?: string
aria-disabled?: boolean | 'true' | 'false'
aria-expanded?: boolean | 'true' | 'false'
aria-haspopup?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | 'true' | 'false'
aria-label?: string
aria-labelledby?: string
aria-pressed?: boolean | 'true' | 'false' | 'mixed'
autoFocus?: boolean
- brandColor?: string
children?: string
excludeFromTabOrder?: boolean
form?: string
formAction?: ButtonHTMLAttributes<HTMLButtonElement>['formAction']
formEncType?: string
formMethod?: string
formNoValidate?: boolean
formTarget?: string
id?: string
isDisabled?: boolean
name?: string
onBlur?: (FocusEvent<Target>) => void
onFocus?: (FocusEvent<Target>) => void
onFocusChange?: (boolean) => void
onKeyDown?: (KeyboardEvent) => void
onKeyUp?: (KeyboardEvent) => void
onPress?: (PressEvent) => void
onPressChange?: (boolean) => void
onPressEnd?: (PressEvent) => void
onPressStart?: (PressEvent) => void
onPressUp?: (PressEvent) => void
preventFocusOnPress?: boolean
- size?: 'S' | 'M' | 'L' | 'XL'
+ size?: 'S' | 'M' | 'L' | 'XL' = 'M'
slot?: string | null
type?: 'button' | 'submit' | 'reset' = 'button'
value?: string
} |
devongovett
approved these changes
Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the AI Button to our AI Guide docs.